/***********************************************************************************************************************************
 * Name:	repl_distributor.sql
 * Author:	Frank Figearo (frank.figearo@us.bbaaviation.com|frank@sqlnerd.me)	
 */
SET IMPLICIT_TRANSACTIONS OFF; IF 0 < @@TRANCOUNT ROLLBACK;
USE [master];
GO
CREATE LOGIN [distributor_admin] WITH PASSWORD= N'eCUkFL4d4G8wKktYUaQw9FDE', DEFAULT_DATABASE= [master], DEFAULT_LANGUAGE= [us_english], CHECK_EXPIRATION= OFF, CHECK_POLICY= ON;
EXECUTE sp_addsrvrolemember 'distributor_admin', 'sysadmin';
GO
EXECUTE dbo.sp_addlinkedserver @server= N'repl_distributor', @srvproduct= N'SQL Server';
EXECUTE dbo.sp_addlinkedsrvlogin
	@rmtsrvname	= N'repl_distributor',
	@rmtuser	= N'distributor_admin',
	@rmtpassword= N'eCUkFL4d4G8wKktYUaQw9FDE';
EXECUTE dbo.sp_serveroption @server= N'repl_distributor', @optname= N'collation compatible',				@optvalue= N'false'
EXECUTE dbo.sp_serveroption @server= N'repl_distributor', @optname= N'data access',							@optvalue= N'false';
EXECUTE dbo.sp_serveroption @server= N'repl_distributor', @optname= N'dist',								@optvalue= N'true';
EXECUTE dbo.sp_serveroption @server= N'repl_distributor', @optname= N'pub',									@optvalue= N'false';
EXECUTE dbo.sp_serveroption @server= N'repl_distributor', @optname= N'rpc',									@optvalue= N'true';
EXECUTE dbo.sp_serveroption @server= N'repl_distributor', @optname= N'rpc out',								@optvalue= N'true';
EXECUTE dbo.sp_serveroption @server= N'repl_distributor', @optname= N'sub',									@optvalue= N'false';
EXECUTE dbo.sp_serveroption @server= N'repl_distributor', @optname= N'connect timeout',						@optvalue= N'0';
EXECUTE dbo.sp_serveroption @server= N'repl_distributor', @optname= N'collation name',						@optvalue= Null;
EXECUTE dbo.sp_serveroption @server= N'repl_distributor', @optname= N'lazy schema validation',				@optvalue= N'false';
EXECUTE dbo.sp_serveroption @server= N'repl_distributor', @optname= N'query timeout',						@optvalue= N'0';
EXECUTE dbo.sp_serveroption @server= N'repl_distributor', @optname= N'use remote collation',				@optvalue= N'true';
EXECUTE dbo.sp_serveroption @server= N'repl_distributor', @optname= N'remote proc transaction promotion',	@optvalue= N'false';
GO